package com.cxs.service.impl;

import com.cxs.mapper.RegisterMapper;
import com.cxs.pojo.RegisterExample;
import com.cxs.service.RegisterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/*
 * @Author:cxs
 * @Date:2021/10/19  16:54
 * @Version 1.0
 * @Motto:放下杂念,只为迎接明天更好的自己
 * */
@Slf4j
@Service
public class RegisterServiceImpl implements RegisterService {

    @Autowired
    private RegisterMapper registerMapper;

    private static final Integer DELETED = 0;

    @Override
    public Long zhuyuanTotal() {
        RegisterExample example = new RegisterExample();
        RegisterExample.Criteria criteria = example.createCriteria();
        criteria.andStateNotEqualTo(DELETED);
        return registerMapper.countByExample(example);
    }

    @Override
    public Long todayTotal() {
        return registerMapper.todayCount();
    }
}
